import request from '@/utils/request';

// 查询盘点单列表
export function listCheckOrder(query: Record<string, any>) {
  return request({
    url: '/wms/checkOrder/list',
    method: 'get',
    params: query
  })
}

// 查询盘点单详细
export function getCheckOrder(orderId: string | number) {
  return request({
    url: '/wms/checkOrder/' + orderId,
    method: 'get'
  })
}

// 新增盘点单
export function addCheckOrder(data: Record<string, any>) {
  return request({
    url: '/wms/checkOrder',
    method: 'post',
    data: data
  })
}

// 修改盘点单
export function updateCheckOrder(data: Record<string, any>) {
  return request({
    url: '/wms/checkOrder',
    method: 'put',
    data: data
  })
}

// 删除盘点单
export function delCheckOrder(orderId: string | number | string[]) {
  const ids = Array.isArray(orderId) ? orderId.join(',') : orderId;
  return request({
    url: '/wms/checkOrder/' + ids,
    method: 'delete'
  })
}

// 导出盘点单
export function exportCheckOrder(query: Record<string, any>) {
  return request({
    url: '/wms/checkOrder/export',
    method: 'post',
    data: query
  })
}

// 盘点单审核
export function auditCheckOrder(orderId: string | number, status: number) {
  return request({
    url: '/wms/checkOrder/audit',
    method: 'put',
    data: { orderId, status }
  })
}

// 盘点单盘点
export function checkCheckOrder(orderId: string | number) {
  return request({
    url: '/wms/checkOrder/check/' + orderId,
    method: 'put'
  })
}

// 生成盘点单
export function generateCheckOrder(data: Record<string, any>) {
  return request({
    url: '/wms/checkOrder/generate',
    method: 'post',
    data: data
  })
}




